package com.zelix;

import javax.swing.*;
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class zz {

    public static Class a[] = new Class[0];
    public static String b = "ESCAPE_ACTION_NAME";
    private static String z = "requestFocusInWindow";

    static void a(Component component) {
        c(component);
    }

    public static boolean a(Color color) {
        int i = color.getRed() + color.getBlue() + color.getGreen();
        return i < 50;
    }

    public static boolean a(Color color, Color color1) {
        return a(color, color1, 150);
    }

    public static boolean a(Color color, Color color1, int i) {
        int j = color.getRed();
        int k = color.getBlue();
        int l = color.getGreen();
        int i1 = color1.getRed();
        int j1 = color1.getBlue();
        int k1 = color1.getGreen();
        int l1 = Math.abs(j - i1);
        l1 += Math.abs(k - j1);
        l1 += Math.abs(l - k1);
        return l1 >= i;
    }

    public static boolean b(Color color) {
        int i = color.getRed() + color.getBlue() + color.getGreen();
        return 765 - i < 50;
    }

    public static void a(Window window) {
        if (SwingUtilities.isEventDispatchThread()) {
            window.pack();
        } else {
            try {
                SwingUtilities.invokeAndWait(new j6(window));
            }
            catch (InterruptedException interruptedexception) {
                throw new z0(interruptedexception.getMessage() + " " + window.getClass().getName());
            }
            catch (InvocationTargetException invocationtargetexception) {
                throw new z0(invocationtargetexception.getTargetException().getMessage() + " " + window.getClass().getName());
            }
        }
    }

    public static void b(Component component) {
        if (SwingUtilities.isEventDispatchThread()) {
            c(component);
        } else {
            SwingUtilities.invokeLater(new k6(component));
        }
    }

    private static void c(Component component) {
        try {
            Method method = component.getClass().getMethod(z, a);
            method.invoke(component, a);
        }
        catch (Throwable _ex) {
            component.requestFocus();
        }
    }

    public static void a(Window window, boolean flag) {
        if (SwingUtilities.isEventDispatchThread()) {
            window.setVisible(flag);
        } else {
            try {
                SwingUtilities.invokeAndWait(new a0(flag, window));
            }
            catch (InterruptedException interruptedexception) {
                throw new z0(interruptedexception.getMessage() + " " + window.getClass().getName());
            }
            catch (InvocationTargetException invocationtargetexception) {
                throw new z0(invocationtargetexception.getTargetException().getMessage() + " " + window.getClass().getName());
            }
        }
    }

//    private static char[] z(String s) {
//        char ac[] = s.toCharArray();
//        int clen = ac.length;
//        if (clen >= 2)
//            return ac;
//        ac[0] ^= 0x15;
//        return ac;
//    }
//
//    private static String z(char ac[]) {
//        for (int i = 0; i < ac.length; i++) {
//            byte key = 0;
//            switch (i % 5) {
//                case 0:
//                    key = 2;
//                    break;
//                case 1:
//                    key = 56;
//                    break;
//                case 2:
//                    key = 11;
//                    break;
//                case 3:
//                    key = 43;
//                    break;
//                default:
//                    key = 21;
//                    break;
//            }
//            ac[i] ^= key;
//        }
//        return new String(ac).intern();
//    }
}
